Skip to content

Bdms 227 transfer updates#257

Merged
jacob-a-brown merged 19 commits into
bdms-227from
bdms-227-transfer-updates
Nov 26, 2025
Merged

Bdms 227 transfer updates#257
jacob-a-brown merged 19 commits into
bdms-227from
bdms-227-transfer-updates

Conversation

@jacob-a-brown

Copy link
Copy Markdown
Contributor

all transfers for additional well information except for aquifer/geology data. this depends on PR #256 being merged since it incorporates api/model/schema changes made for the tests to pass

Comment thread db/thing.py
Comment thread schemas/thing.py Outdated
Comment on lines +38 to +40
# from schemas.geologic_formation import (
# GeologicFormationResponse,
# )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we still need a GeologicFormationResponse?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we do. The feature file states that it should just return the formation codes, so I parse all of the geologic formation and just return the codes as plain strings

Comment thread schemas/thing.py Outdated
GeologicFormationResponse,
ThingGeologicFormationAssociationResponse,
)
from schemas.aquifer_system import AquiferSystemGeoJSONResponse

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided to forego the GeoJSON response?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was used in the WellResponse and I forgot it was there. I've now changed it so that a string of the aquifer system name is returned

Comment thread schemas/thing.py Outdated
Comment on lines +248 to +251
allow_water_level_samples: bool | None
allow_water_chemistry_samples: bool | None
allow_datalogger_installation: bool | None
is_suitable_for_datalogger: bool | None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look like fields from the previous PermissionHistory table design. Should these fields be removed and replaced with permission_type and/or permission_allowed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if you are getting this twice. I somehow started a review of my own PR, which I just deleted so now I need to comment again:

The steps in the feature file are

And the response should include whether repeat measurement permission is granted for the well
And the response should include whether sampling permission is granted for the well
And the response should include whether datalogger installation permission is granted for the well

so I'm just returning boolean values based off of the latest response where end_date is None. This data is, however, stored in the PermisionHistory table.

@chasetmartin do you want the response to be single fields like this, or would you prefer that it more closely reflect the database design? If so I can change it to

{
...
"permissions": [
  {"permission_type": "Water Level Sample", "permission_allowed": True/False},
  {"permission_type": "Water Chemistry Sample", "permission_allowed": True/False},
  {"permission_type": "Datalogger Installation", "permission_allowed": True/False}
]
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacob-a-brown I like the later, the list of permission objects, I think it's almost more intuitive to read/parse. What do you think @TylerAdamMartinez ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's make it more closely resemble the database design.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want it to return all permissions, even if they have ended? Or just the latest permissions (that is, latest start_date where end_date is None)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the permissions are now returned in a list

{
...
"permissions": [
  {"permission_type": "Water Level Sample", "permission_allowed": True/False, "start_date": date, "end_date": None},
  {"permission_type": "Water Chemistry Sample", "permission_allowed": True/False, "start_date": date, "end_date": None},
  {"permission_type": "Datalogger Installation", "permission_allowed": True/False, "start_date": date, "end_date": None}
]
}
  • Only the latest record (based off of start_date) where end_date is None is returned for each type
  • If the permission record does not exist for a particular permission_typethen permission_allowed, start_date, and end_date are None.
  • while start_date is non-nullable in the database, it must be nullable in the response incase there are no permissions of particular type
  • end_date will always be None for active permissions. I'm including it in the PermissionHistory response, though, so that if we want to list out the full permission history for an object it'll be there

@ksmuczynski ksmuczynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good! Left a few comments.

the well screen response includes the aquifer and geology information,
but just as strings of names and codes instead of the full nested response objects.

@ksmuczynski ksmuczynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@jacob-a-brown jacob-a-brown merged commit d81de21 into bdms-227 Nov 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants